UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GWxderMo+z+6BuS61c6URyUR/eWlJswumbui9DMUws4=' 
WHERE 
  key_id = '070f16888acd6ba6e7c442f741b0ad99b9c6f1a7578645dc13aa8643af5f0f6c' 
  AND (
    token = 'GWxderMo+z+6BuS61c6URyUR/eWlJswumbui9DMUws4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027