UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Y8SP/X0DwzxqRnXHAbD0iRjuJGFgOr1T/dzJZOvT5eA='
WHERE
key_id = '6c87c68554fba58ade2310bfe7634c5841d4074963d5e6ad627b25d93dca9783'
AND (
token = 'Y8SP/X0DwzxqRnXHAbD0iRjuJGFgOr1T/dzJZOvT5eA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)