UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'pZwrN5So4ogyljxvFF1E3okHcTzzMEjMWtVwjKV0NV8=' 
WHERE 
  key_id = '1c16ac27d90e7d5740b3c1c2f4ac9f0d5c4fd0b950b178c0fd26cfefc863200a' 
  AND (
    token = 'pZwrN5So4ogyljxvFF1E3okHcTzzMEjMWtVwjKV0NV8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025