UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'XNdw7iehk6ZuZjQKCBhbaxVqbI0Z/sFmEDzMYq9OrAo='
WHERE
key_id = '1c2969b0b0e419ac9c28ae0fddcd79f355a12aa2fc4a71d3dd835029bc99e3ec'
AND (
token = 'XNdw7iehk6ZuZjQKCBhbaxVqbI0Z/sFmEDzMYq9OrAo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)