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

Query time 0.00030