UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mfr9kwx/1D3P6VYDip+yL2qAI8Ya9PQPNwehfdvzKEc=' 
WHERE 
  key_id = '65bf2e8068ca74aaa646bbfb008afee947a3a7a1bb958266873f4fef3421420b' 
  AND (
    token = 'mfr9kwx/1D3P6VYDip+yL2qAI8Ya9PQPNwehfdvzKEc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038