UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'OOVvpZJv7GjgdG/vH9GSFfvQi5QDadE5v5LMoTL3Rso='
WHERE
key_id = 'f411ef0ebe5f72808bdd1c442026f367e3f5c5328077b027b13c9979a8ef5b40'
AND (
token = 'OOVvpZJv7GjgdG/vH9GSFfvQi5QDadE5v5LMoTL3Rso='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)