UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ygm6qQwVa+A0+Mxyn8jtYXaThADcsUhVqdx1iaN7e9g='
WHERE
key_id = '1b4fb823c4256c1d5f8413ffa4f73e172eb4261b412b0cce43e6fd08a39575eb'
AND (
token = 'ygm6qQwVa+A0+Mxyn8jtYXaThADcsUhVqdx1iaN7e9g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)