UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'JwbSolgVEUIoZ+yWfP4hhv5j4vKyXekl4IHG11u5xIo='
WHERE
key_id = '690b0e49c9910a1bfe51c8086ef56dbbc6ab42cb54ac96bf0cf3a8d23a686069'
AND (
token = 'JwbSolgVEUIoZ+yWfP4hhv5j4vKyXekl4IHG11u5xIo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)