UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DMf1RaAypivXjhNBWSVKNlLUFsF7C+g+MK8a9uGtGqs='
WHERE
key_id = '22a4d773b3db599821a5e1588fc9b8914dbcc982292d1a52d0a43cf6ee36fbbf'
AND (
token = 'DMf1RaAypivXjhNBWSVKNlLUFsF7C+g+MK8a9uGtGqs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)