UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0GVEgYNWUrc/I1SDsXvXcgyxfyJ/iqNkENOgSAtwfn0=' 
WHERE 
  key_id = 'ff90c1b7cf8a32a0f1a33968e3fbe280da47c754f0f5b59274ef9714b9288ec5' 
  AND (
    token = '0GVEgYNWUrc/I1SDsXvXcgyxfyJ/iqNkENOgSAtwfn0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016