UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4GrHXurSLjsWIrhIeBhgtBOKG6zWs2tAeGSHntxiloo=' 
WHERE 
  key_id = 'fe280777bb96fedba31c3d66d91349ef3005e0d177b4dfe124bbedd79fd4827d' 
  AND (
    token = '4GrHXurSLjsWIrhIeBhgtBOKG6zWs2tAeGSHntxiloo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032