UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4HDv0Wl1N22eVrNeFq2hguF45HcUmOOmRZQdLZ0OEjU='
WHERE
key_id = '1edfab9f2360440a40e6db028c09082ede8a6e34ed26b409e0f57d9275a2173a'
AND (
token = '4HDv0Wl1N22eVrNeFq2hguF45HcUmOOmRZQdLZ0OEjU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)