UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/Tnnc3wX4Mux2gxp617PbrhJwGvw0pc7BbMUOFZSCm8='
WHERE
key_id = '832c67500363c109d15fc636da1e74ff8ab2d70217f82fe0e8df27f93ebdbaf9'
AND (
token = '/Tnnc3wX4Mux2gxp617PbrhJwGvw0pc7BbMUOFZSCm8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)