UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nexCFoKmWGXJGiaZ/SZzvd6LGc6mqi72tDN5Q9s5iac='
WHERE
key_id = 'ac357663722b2c990e0f6ece8f3dc315c62bc95d1a2d55bc9bd256d04f16ee8d'
AND (
token = 'nexCFoKmWGXJGiaZ/SZzvd6LGc6mqi72tDN5Q9s5iac='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)