UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1QQDtlhZZyG+EiXOG1RaSGSDzRgb7dP/96WpNbUNn98='
WHERE
key_id = '46f730f651ac52d9ea32130d35d38acff298768e90321cd5a88d04b8401fc0fe'
AND (
token = '1QQDtlhZZyG+EiXOG1RaSGSDzRgb7dP/96WpNbUNn98='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)