UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zk97yXver84H4pAbB5yAX4KLUDA0o0DsiP/cRLKln/k=' 
WHERE 
  key_id = '529dc2563b464f44d7e96761ad572e7c22ba230b704de2de5831935eeaed5217' 
  AND (
    token = 'zk97yXver84H4pAbB5yAX4KLUDA0o0DsiP/cRLKln/k=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038