UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'FQw/avZZ/p/oxo67v6VgLNIsvkbe/uPSKkk3nFgRwIM='
WHERE
key_id = '675c6375ca7e392eeb5bc84b9a9e6f6841edb16f5a491d2ae3f070d658a6d9fb'
AND (
token = 'FQw/avZZ/p/oxo67v6VgLNIsvkbe/uPSKkk3nFgRwIM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)