UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3mkl0jZq9rtYHUyAd1dmFE6jILw2PVveTNy5yiRmpew='
WHERE
key_id = '15d66d44ba418890de2e34f131f44d336ddfcac648a79f98dd8ed1d83c928b49'
AND (
token = '3mkl0jZq9rtYHUyAd1dmFE6jILw2PVveTNy5yiRmpew='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)