UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'kB2GoHAHdgkVRev/Vii+JfFCJJrzrdbj+z1+v+NHeWo=' 
WHERE 
  key_id = 'e632e9d82c4c54cb7d28e8a5e08fad352d5f0b4edda65d3e24ddaed8534e7a68' 
  AND (
    token = 'kB2GoHAHdgkVRev/Vii+JfFCJJrzrdbj+z1+v+NHeWo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027