UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2wKCU3usEowPRYsSE/0JBXMP6e4SyO90E2NNyMtY7VI=' 
WHERE 
  key_id = 'f9457359d25758ea0655774b81d4742467e9321b6afea31a211f1bd2319552aa' 
  AND (
    token = '2wKCU3usEowPRYsSE/0JBXMP6e4SyO90E2NNyMtY7VI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029