UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4vVXX4K0Z2LFY2m/YbXjzmzreTeMHSkdX3VeQYIrt+Q=' 
WHERE 
  key_id = '233be25cbabfc336575fd244b4aeddf6f495f7d618cdf68757a160b7d1ed516f' 
  AND (
    token = '4vVXX4K0Z2LFY2m/YbXjzmzreTeMHSkdX3VeQYIrt+Q=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030