UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/pbWvEN1er0eElgIQFpYynv6Unvw02GHl2rYHErwO6k=' 
WHERE 
  key_id = '55e9fcd7721a968f283456fdb3526379481c546e7ae07a81a3face70d0222871' 
  AND (
    token = '/pbWvEN1er0eElgIQFpYynv6Unvw02GHl2rYHErwO6k=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035