UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'WLAim9VknZl19HYFt/yDwZQTymfPvV9bHEq7LbOAi24=' 
WHERE 
  key_id = '2fee418bd784abb98379598243251dc081092e0ec6f854ece36627d0f303b8e3' 
  AND (
    token = 'WLAim9VknZl19HYFt/yDwZQTymfPvV9bHEq7LbOAi24=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031