UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'WkF3M4pz7yx7WD+Y0Ito53cWCz3cHzbrUYRT/fVZmRQ=' 
WHERE 
  key_id = '9e89f08b9a61b627b3ad1a5c7371c1a1ec6c695815dcc76d8527ceeae60fe8d4' 
  AND (
    token = 'WkF3M4pz7yx7WD+Y0Ito53cWCz3cHzbrUYRT/fVZmRQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022