UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PFv6BlTAvVO/5PXaP1EB6poVyVEB2uwDIPannL6M2lQ='
WHERE
key_id = '5dc687bd5e593e5b1a329bdd8b46438d453d56938b7c96ed75e15903f0d7e200'
AND (
token = 'PFv6BlTAvVO/5PXaP1EB6poVyVEB2uwDIPannL6M2lQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)