UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QzHHqRpsQUcVvxHfAbvOBluF4wcznorB0dlwBnbcVXY='
WHERE
key_id = '4210703b60ee80bb61ce5975092008b296392f7e56bbe386f1af71dbfae67cf2'
AND (
token = 'QzHHqRpsQUcVvxHfAbvOBluF4wcznorB0dlwBnbcVXY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)