UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9jMd3TPziewN2sqXGv8U0bt83iV24V5K2feo6/dkq6M=' 
WHERE 
  key_id = 'e2ad7323e38d41697c60d4b70b211f9f868124f71833487ba59bf6b08a96e7ea' 
  AND (
    token = '9jMd3TPziewN2sqXGv8U0bt83iV24V5K2feo6/dkq6M=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037