UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UE9cbqCfeOs9fe7fZyXHOJRIr1lDHt1PSPQ9X/7or6s='
WHERE
key_id = '5f2ee3169600a0ec06b4e324ecd852b4f57e73100e1d5bbf67c74a385c1db118'
AND (
token = 'UE9cbqCfeOs9fe7fZyXHOJRIr1lDHt1PSPQ9X/7or6s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)