UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3MULeGwSoUez+2D7NL0G6vkrox8R/N6xJvnzIuoxXOU='
WHERE
key_id = 'a7d4cf5f6a6c2f88d1bb9bf70144d2b3a748fff4071da13261ca0d2a91d9a5dd'
AND (
token = '3MULeGwSoUez+2D7NL0G6vkrox8R/N6xJvnzIuoxXOU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)