UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'esbiAJrtuG3wZrCLF6tXbdxcK8WP8+/GSdjFNRnTIfo=' 
WHERE 
  key_id = 'a0cfed61127694852debeaaea1b277e9a196215a6d303268cbee9cd9018f1213' 
  AND (
    token = 'esbiAJrtuG3wZrCLF6tXbdxcK8WP8+/GSdjFNRnTIfo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017