UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'JT0o98JQPyrLRnjftVgEhsSgPS1tVQs3TJP0A00sjWU=' 
WHERE 
  key_id = 'd2189d031aeaf2a16ba03c8978e8d4f71335bc04fc52762fc281bef9ea574c2b' 
  AND (
    token = 'JT0o98JQPyrLRnjftVgEhsSgPS1tVQs3TJP0A00sjWU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021