UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'FWkn5yQ+wRyo6nfcn6azITsMqxSy0ygxCcMDp4Z7kug='
WHERE
key_id = 'e5a075328c9e605ff020b70de92de629cf41ee27e1c212493f91b67142435e9a'
AND (
token = 'FWkn5yQ+wRyo6nfcn6azITsMqxSy0ygxCcMDp4Z7kug='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)