UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Lghg4OrnSEz45lu3dnNiO6l/kLNSUfCtQHASV6hlNFE=' 
WHERE 
  key_id = '71ce40ab7d2a02493f2501f75ebecdbe37342d675b8d446536f441f0e41de9f4' 
  AND (
    token = 'Lghg4OrnSEz45lu3dnNiO6l/kLNSUfCtQHASV6hlNFE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028