UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ML6ekrTXFprpJlyq0L6YQY6z13/IMX15+zqWc8jnqbU='
WHERE
key_id = '8c8498d53ee9773143e33842ddd6105fd5549b4bbaeaece22b47a449f177b620'
AND (
token = 'ML6ekrTXFprpJlyq0L6YQY6z13/IMX15+zqWc8jnqbU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)