UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'AFcWeidGUOFjWGKiNRwcUojwAczNblzZ/w4O72cx8K0='
WHERE
key_id = '8d30372b1cffa50665f10ca0578dd7828dd67a58531cb43ec2cc5fc9a4b5d9e5'
AND (
token = 'AFcWeidGUOFjWGKiNRwcUojwAczNblzZ/w4O72cx8K0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)