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

Query time 0.00030