UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2STjamnMlkwhSu6GETntVK1prN2fMv41V7bWKOh7B9g='
WHERE
key_id = 'dad2047cfe9500278fc0d561610e3f5019e165b29dd7b69d0651134758b2ac62'
AND (
token = '2STjamnMlkwhSu6GETntVK1prN2fMv41V7bWKOh7B9g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)