UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DbpZ29ZxaVwTkCe2FjY4NjD212QwZxP3HXTYt+Sx0Hk='
WHERE
key_id = '9d62f7e94092653c29f4f085e7f9022f8b26da433d83d0e0720e9b610de4ddab'
AND (
token = 'DbpZ29ZxaVwTkCe2FjY4NjD212QwZxP3HXTYt+Sx0Hk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)