UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Scb+40Avc+Tv2WbiMSa7EmXlblpOXChjhcQk1gqzHXQ='
WHERE
key_id = '2c31976e41f25f40d9c9e3462a1c7c14eb0c28e944672c23cd1eae7a228462eb'
AND (
token = 'Scb+40Avc+Tv2WbiMSa7EmXlblpOXChjhcQk1gqzHXQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)