UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LzfwDOfoyA4Fg5K0PywQbxuFsQ/bj0qmjn6rEkQxXas='
WHERE
key_id = '765a81849ff04dc4e62c296269518b59276122c9f6321717a938853bad2af5f8'
AND (
token = 'LzfwDOfoyA4Fg5K0PywQbxuFsQ/bj0qmjn6rEkQxXas='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)