UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8rdoXk0JUGTv7gq56dYV1EEK6Rve2kS9NIoZsRt/PHo='
WHERE
key_id = '33dc53a0c824144b03ff3c6868c14d3e1bb413a54281df16bbe74406ec14a807'
AND (
token = '8rdoXk0JUGTv7gq56dYV1EEK6Rve2kS9NIoZsRt/PHo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)