UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4nbvLcOGVj9YvNZI9on7fxLRnLzn7LEBHS6yA7HpyhQ='
WHERE
key_id = '2021c1b0a4ec7e023aec70e61d16f8ad895d2e04e3b5ccb72b917a1c99420add'
AND (
token = '4nbvLcOGVj9YvNZI9on7fxLRnLzn7LEBHS6yA7HpyhQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)